import request from '@/utils/request'

export default {
  getList(data) {
    return request({
      url: `/api/role/getList`,
      method: 'post',
      data
    })
  },
  getPage(page, pageSize, data) {
    return request({
      url: `/api/role/getPage/${page}/${pageSize}`,
      method: 'post',
      data
    })
  },
  add(data) {
    return request({
      url: `/api/role/add`,
      method: 'post',
      data
    })
  },
  get(id) {
    return request({
      url: `/api/role/get/${id}`,
      method: 'post'
    })
  },
  update(data) {
    return request({
      url: `/api/role/update`,
      method: 'post',
      data
    })
  },
  status(id, status) {
    return request({
      url: `/api/role/status/${id}/${status}`,
      method: 'post'
    })
  },
  delete(id) {
    return request({
      url: `/api/role/delete/${id}`,
      method: 'post'
    })
  },
  configRoleForUsers(roleId, optType, data) {
    return request({
      url: `/api/role/configRoleForUsers/${roleId}/${optType}`,
      method: 'post',
      data
    })
  },
  getBoundUsers(roleId) {
    return request({
      url: `/api/role/getBoundUsers/${roleId}`,
      method: 'post'
    })
  },
  configMenuForRole(roleId, data) {
    return request({
      url: `/api/role/configMenuForRole/${roleId}`,
      method: 'post',
      data
    })
  },
  getBoundMenus(roleId) {
    return request({
      url: `/api/role/getBoundMenus/${roleId}`,
      method: 'post'
    })
  },
  configOrgForRole(roleId, data) {
    return request({
      url: `/api/role/configOrgForRole/${roleId}`,
      method: 'post',
      data
    })
  },
  getBoundOrgs(roleId) {
    return request({
      url: `/api/role/getBoundOrgs/${roleId}`,
      method: 'post'
    })
  }
}
